<extend name="Layout:layout_dialog" />
<block name="body_main">
    <form action="{:U('file_edit_save')}" method="post" class="xsui-form" enctype="multipart/form-data">
        <fieldset>
            <div class="xsui-form-field">
                <label>标题：</label>
                <input type="text" name="title" placeholder="标题" value="{$data.title}" required="required" />
            </div>
            <div class="xsui-form-field">
                <label>类别：</label>
                <select name="category_id" data-url="{:U('Channels/get_channel_tree_json','type_id=5')}" data-value="{$data.category_id}"></select>
            </div>
            <div class="xsui-form-field">
                <label>图片：</label>
                <sohtml:file name="picture_url" value="{$data.picture_url}" />
            </div>
            <div class="xsui-form-field">
                <label>文件：</label>
                <sohtml:file name="file_path" value="{$data.file_path}" />
            </div>
            <div class="xsui-form-field">
                <label>自动命名：</label>
                <input type="checkbox" name="auto_name" value="Y" checked="true" />
                <span class="xsui-danger">(使用系统随机生成的文件名可以避免文件重名冲突,保持原文件名请勿勾选此项!)</span>
            </div>
            <div class="xsui-form-field-vertical">
                <label>摘要内容：</label>
                <textarea name="summary" placeholder="摘要内容" cols="90" rows="3" style="width:99%">{$data.summary}</textarea>
            </div>
            <div class="xsui-form-field xsui-form-mgb">
                <label>状态：</label>
                <sohtml:radio name="status" items="1:显示;0:隐藏" value="{$data.status|default=1}" required="required" />
            </div>
        </fieldset>
        <button type="submit" class="ui-state-default"><i class="fa fa-save"></i>保存</button>
        <button type="reset" class="ui-state-default">重置</button>
        <input type="hidden" name="id" value="{$data.id}"/>
        <input type="hidden" name="site_id" value="{$data.site_id}"/>
        <input type="hidden" name="user_name" value="{$data.user_name}"/>
    </form>
</block>
<block name="body_after">
    <script>
        $(function () {
            ajax_combobox({selector: 'select[name="category_id"]', def_option: '请选择类别'});
        })
    </script>
</block>